package org.opens.service;

import org.opens.entity.MyBatisPerson;
import org.opens.service.hystrix.MybatisPersonServiceHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 说明:
 * <pre>
 *     1. fallback属性配置的熔断类必须被@Component修饰, 否则无法触发, 甚至会导致应用无法启动.
 * </pre>
 */
@FeignClient(value = "business", fallback = MybatisPersonServiceHystrix.class)
public interface MybatisPersonService {

    @RequestMapping(value = "/api/mybatis/person/{id}")
    public MyBatisPerson queryOneByPK(
            @PathVariable(value = "id") Integer id
    );

}
